package firear.caipiaomonitor;

public class Rule {
    /*
    * 0 ou
    * 1 ji
    * */
    public static int [] jisushishicai = {
        0,0,0,0,0
    };

    public static void setRule(int []rule){
        jisushishicai = rule;
    }

    private static boolean match(int dst, int val){
        if(dst == 0 && val%2 == 0) {
            return true;
        }else return dst == 1 && val % 2 != 0;

    }
    public static boolean match(String[] value){
        boolean ret = true;
        if(value.length == 5){
            for(int i = 0; i < 5; i++){
                if(!match(jisushishicai[i], Integer.parseInt(value[i]))){
                    ret = false;
                    break;
                }
            }
        }else {
            ret = false;
        }
        return ret;
    }
}
